<?php
// 简单工厂

require_once '../autoload.php';

try {
    $operation = OperationFactory::createOperation('+');
    $operation->a = 123;
    $operation->b = 321;
    $res = $operation->getResult();
    fwrite(STDOUT, $res);
} catch (Exception $exception) {
    fwrite(STDOUT, $exception->getMessage());
}